Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added control to create logs by Lambda@Edge in all regions #462

Conversation

rysi3k
Copy link
Contributor

@rysi3k rysi3k commented May 16, 2023

Description

Added simple flag, for not create IAM policy which allows to create logs by Lambda@Edge in regions other than N.Virginia.

Motivation and Context

In some cases that logs are not necessary, but storing it costs extra $.

Breaking Changes

NO

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of restricting logs by region, but I propose changing the name of the variable to something like lambda_at_edge_logs_all_regions.

Also, please remove the changes from examples/complete/main.tf as it is a very minor case.

variables.tf Outdated
@@ -50,6 +50,12 @@ variable "lambda_at_edge" {
default = false
}

variable "create_lambda_at_edge_all_regions_access_policy" {
description = "Set this to false if you do not want to create Lambda@Edge logs in all regions"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "Set this to false if you do not want to create Lambda@Edge logs in all regions"
description = "Whether to specify a wildcard in IAM policy used by Lambda@Edge to allow logging in all regions"

@@ -262,6 +262,7 @@ module "lambda_at_edge" {
source = "../../"

lambda_at_edge = true
create_lambda_at_edge_all_regions_access_policy = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
create_lambda_at_edge_all_regions_access_policy = false

@antonbabenko antonbabenko changed the title Do not allow to create logs by Lambda@Edge in all regions feat: Added control to create logs by Lambda@Edge in all regions May 16, 2023
@rysi3k rysi3k force-pushed the do_not_allow_to_create_logs_in_all_regions branch from 6b66eb9 to bcff87b Compare May 16, 2023 15:38
@rysi3k
Copy link
Contributor Author

rysi3k commented May 16, 2023

@antonbabenko changed according to your suggestions

@antonbabenko antonbabenko merged commit 712d8ec into terraform-aws-modules:master May 17, 2023
antonbabenko pushed a commit that referenced this pull request May 17, 2023
## [4.18.0](v4.17.0...v4.18.0) (2023-05-17)

### Features

* Added control to create logs by Lambda@Edge in all regions ([#462](#462)) ([712d8ec](712d8ec))
@antonbabenko
Copy link
Member

This PR is included in version 4.18.0 🎉

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants